<div class="layui-card">
    <div class="layui-card-body">
        <div>
            <form action=""  class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-input-inline">
                        <input type="text" name="keywords" value="{$search.keywords}" class="layui-input" placeholder="模板名称">
                    </div>
                    <div class="layui-input-inline">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
                    </div>
                </div>
            </form>

            <form action="{:url('admin/sms.template/deltemplate')}" method="post" class="layui-form delete-form" id="cp-form">
                <div class="layui-btn-group">
                    <a href="{:url('admin/sms.template/addtemplate')}" class="layui-btn layui-btn-xs">
                        <i class="layui-icon layui-icon-addition"></i>
                        添加模板
                    </a>
                    <button type="submit" class="layui-btn layui-btn-xs layui-btn-danger ">
                        <i class="layui-icon">&#xe640;</i>
                        删除模板
                    </button>
                </div>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th width="10">
                            <input type="checkbox" class="layui-input"  lay-skin="primary" lay-filter="select-all">
                        </th>
                        <th width="120">模板签名</th>
                        <th width="300">模板名称</th>
                        <th width="200">模板CODE</th>
                        <th width="200">模板类型</th>
                        <th >操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="dataList" id='v'}
                    <tr>
                        <td align="center" valign="middle">
                            <input type="checkbox" name="idList[]" class="layui-input" lay-skin="primary" value="{$v.id}">
                        </td>
                        <td>{$v.template_sign}</td>
                        <td>{$v.template_name}</td>
                        <td>{$v.template_code}</td>
                        <td>
                            {switch name='v.template_type' }
                            {case value='1'}短信通知{/case}
                            {case value='2'}验证码{/case}
                            {case value='3'}推广短信{/case}
                            {/switch}
                        </td>
                        <td>
                            <a href="{:url('admin/sms.template/edittemplate',['id'=>$v['id']])}" class="layui-btn layui-btn-xs layui-btn-danger ">
                                <i class="layui-icon layui-icon-edit"></i>
                                编辑
                            </a>
                           <button class="layui-btn layui-btn-xs testtemplate"  type="button" data-href="{:url('admin/sms.template/test',['id'=>$v.id])}">群发</button>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </form>
            {$dataList|raw}
        </div>
    </div>
</div>